package cn.kgc.jjl.workhome;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class PersonTest {
	public static void main(String[] args) throws IOException {
		//序列化	
		FileOutputStream fos =new FileOutputStream("d:/a.txt");
		ObjectOutputStream oos = new ObjectOutputStream(fos);
		
		
		
		//创建对象
		Person per = new Person();
		per.setAge(45);
		per.setName("吴明泽吃老八");
		
	
		
		//写对象
		oos.writeObject(per);
		
		oos.close();
		fos.close();
	}

}
